import request from '@/utils/request'
import {logService as logRequest} from '@/utils/request'

function getHotStandbyLogSource(params) {
  return request({
    url: '/api/hotstandbylogsource/getHotStandbyLogSources',
    method: 'get',
    params
  })
}

function getHotStandbyLogTable(params) {
  return request({
    url: '/api/hotstandbylogtable/getHotStandbyLogTables',
    method: 'get',
    params
  })
}

function download(params) {
  return logRequest({
    url: '/api/messagecenter/downLoadLog',
    method: 'get',
    params
  })
}

function getLibTask(params) {
  return request({
    url: 'api/synccompletelibrarytask/page',
    method: 'get',
    params
  })
}
function getLib(params) {
  return request({
    url: 'api/synccompletelibrary/page',
    method: 'get',
    params
  })
}

function getSyncFullAuditTask(params) {
  return request({
    url: 'api/syncfullaudittask/page',
    method: 'get',
    params
  })
}

function getSyncFullAuditDetail(params) {
  return request({
    url: 'api/syncfullauditdetail/page',
    method: 'get',
    params
  })
}
function getSyncFullAudit(params) {
  return request({
    url: 'api/syncfullaudit/page',
    method: 'get',
    params
  })
}

function getTableSyncConfs(params) {
  return request({
    url: 'api/tableSyncConf/page',
    method: 'get',
    params
  })
}

function getTableSyncConf(id) {
  return request({
    url: `api/tableSyncConf/${id}`,
    method: 'get'
  })
}

function addTableSyncConf(data) {
  return request({
    url: `api/tableSyncConf`,
    method: 'post',
    data
  })
}
function editTableSyncConf(data) {
  return request({
    url: `api/tableSyncConf`,
    method: 'put',
    data
  })
}
function delTableSyncConf(id) {
  return request({
    url: `api/tableSyncConf/${id}`,
    method: 'delete'
  })
}

function getHotStandbyTable(params) {
  return request({
    url: `/api/hotStandbyTable/page`,
    method: 'get',
    params
  })
}

function levelRetry(data) {
  return request({
    url: `api/synccompletelibrarytask/levelRetry`,
    method: 'post',
    data
  })
}

function sourceRerun(data) {
  return request({
    url: `api/syncruleconf/levelRetry`,
    method: 'post',
    data
  })
}

function tableRerun(data) {
  return request({
    url: `api/syncruleconf/tableRetry`,
    method: 'post',
    data
  })
}
export default {
  getHotStandbyLogSource,
  getHotStandbyLogTable,
  download,
  getLibTask,
  getLib,
  getSyncFullAuditTask,
  getSyncFullAuditDetail,
  getSyncFullAudit,
  getTableSyncConfs,
  getTableSyncConf,
  addTableSyncConf,
  editTableSyncConf,
  delTableSyncConf,
  getHotStandbyTable,
  levelRetry,
  sourceRerun,
  tableRerun
}
